package ant;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/9/27
 * @project AutumnOffer
 * @description
 **/
public class Solution1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> lis = new ArrayList<>();
        boolean[] vis = new boolean[n];
        int num = 0;
        boolean b = backTrack(lis,n,num,vis);
        if(b){
            for(int i=0;i<n;i++){
                System.out.println(lis.get(i)+" ");
            }
        }else{
            System.out.println(-1);
        }
    }
    public static boolean backTrack(List res,int n,int num,boolean[] vis){
        if(num == n&&res.size() == n){
            return true;
        }
        for(int i=0;i<n;i++){
            if(!vis[i]){
                vis[i] = true;
                if((int)res.get(i)+i != 1 )
                    res.add(i);
                backTrack(res,n,num+1,vis);
                res.remove(res.size()-1);
                vis[i] = false;
            }else {
                break;
            }
        }
        return false;
    }
}
